class Pagination(object):
    def __init__(self, curr, filter_queryset, limit=10):
        self.curr = curr  # 当前页
        self.filter_queryset = filter_queryset
        self.count = self.filter_queryset.count  # 总数
        self.limit = limit

    @property
    def start(self):
        return (self.curr - 1) * self.limit

    @property
    def end(self):
        return self.start + self.limit

    @property
    def queryset(self):
        return self.filter_queryset[self.start: self.end]
